package com.weiyuwqj.server.mapper;

import com.weiyuwqj.api.model.BusAccount;
import com.weiyuwqj.api.model.vo.BalanceInfoVo;
import com.weiyuwqj.api.model.vo.BusAccountVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Repository
public interface BusAccountMapper extends Mapper<BusAccount> {


    BusAccount getBusAccountByUserId(int userId);

    List<BusAccountVo> getList(Map<String, Object> param);


    int updateBusAccountByUserId(BusAccount account);

    int deal(@Param("act") BusAccount account,
             @Param("dealUsableAmt") BigDecimal dealUsableAmt,
             @Param("dealFrozenAmt") BigDecimal dealFrozenAmt,
             @Param("dealWaitAmt") BigDecimal dealWaitAmt,
             @Param("dealRepayAmt") BigDecimal dealRepayAmt,
             @Param("dealCashAmt") BigDecimal dealCashAmt
    );

    int dealAccount(@Param("act") BusAccount account,
                    @Param("dealUsableAmt") BigDecimal dealUsableAmt,
                    @Param("dealFrozenAmt") BigDecimal dealFrozenAmt,
                    @Param("dealWaitAmt") BigDecimal dealWaitAmt,
                    @Param("dealRepayAmt") BigDecimal dealRepayAmt,
                    @Param("dealCashAmt") BigDecimal dealCashAmt
    );

    //后台首页统计金额
    Map<String,Object> sumAmount();

    Map<String,Object> statAccount(Map map);


    List<BusAccountVo> listByGuaranteeId(Map<String, Object> map);

    Map sumInvestAmount();

    //查询资金
    List<BalanceInfoVo> listBalanceInfo(Map map);
}